{% extends 'base.html' %}

{% block content %}
<div class="container mt-5">
    <h2>答题结果</h2>

    <div class="alert alert-success" role="alert">
        你的总分是: {{ total_score }}
    </div>

    <p>正确的题目数量: {{ correct_count }}</p>
    <p>错误的题目数量: {{ wrong_count }}</p>

    <h3>错误题目所属知识点</h3>
    <ul>
        {% for kp in wrong_knowledge_points_info %}
        <li>{{ kp['knowledge_point_name'] }} ({{ kp['course_name'] }}) - 错误数量: {{ kp['wrong_count'] }}</li>
        {% endfor %}
    </ul>

    {% if weakest_knowledge_point %}
    <h3>最薄弱的知识点是: {{ weakest_knowledge_point['knowledge_point_name'] }}</h3>
    <form method="POST" action="{{ url_for('create_focus_study_paper') }}">
        <input type="hidden" name="knowledge_point_id" value="{{ weakest_knowledge_point['knowledge_point_id'] }}">
        <button type="submit" class="btn btn-primary btn-lg mt-3">创建加强学习试卷</button>
    </form>
    {% endif %}

    <a href="{{ url_for('student_dashboard') }}" class="btn btn-primary">返回首页</a>
</div>
{% endblock %}
